package com.example.client.test.service.impl;

import com.example.client.test.domain.User;
import com.example.client.test.mapper.UserMapper;
import com.example.client.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@CacheConfig(cacheNames = "user")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;


    @Override
    @Cacheable(keyGenerator = "UserGenerator")
    public List<User> getAllUser() {
        return userMapper.listAllUser();
    }
}
